#region

using DomainModel.Domain.Model.MessageTypeModel;
using FluentNHibernate.Mapping;

#endregion

namespace DomainModel.Infrastructure.Mappings
{
    public class MessageTypeMap : ClassMap<MessageType>
    {
        public MessageTypeMap()
        {
            CompositeId(x => x.Id).KeyProperty(x => x.Id);

            Map(x => x.Name);
            Map(x => x.Hash);
            Component(x => x.TypeDescription);

            HasManyToMany(x => x.MessageAssembliesList)
                //.AsBag()
                .Table("MessageTypeMessageAssembly")
                .Inverse();
        }
    }
}